package com.cabinet.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cabinet.service.IDiauthorityService;
import com.cabinet.service.dao.DiauthorityDao;
import com.cabinet.web.entity.Diauthority;

@Service
public class DiauthorityService implements IDiauthorityService{
	
	@Autowired
	private DiauthorityDao diauthorityDao;

	@Override
	public Diauthority getDauthorityById(Long id) {
		// TODO Auto-generated method stub
		return diauthorityDao.findOne(id);
	}

	@Override
	public Diauthority getDauthorityBySellerIdAndUserId(Long sellerid, Long userid) {
		// TODO Auto-generated method stub
		return diauthorityDao.getDauthorityBySellerIdAndUserId(sellerid, userid);
	}

	@Override
	public List<Diauthority> getDauthorityListBySellerId(Long sellerid) {
		// TODO Auto-generated method stub
		return diauthorityDao.getDauthorityListBySellerId(sellerid);
	}

	@Override
	public void addDiauthority(Diauthority d) {
		// TODO Auto-generated method stub
		diauthorityDao.save(d);
	}

	@Override
	public void deleteDiauthority(Diauthority d) {
		// TODO Auto-generated method stub
		diauthorityDao.delete(d);
	}

}
